﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——调入单
    /// </summary>
    [Serializable]
    [Description("调入单")]
    public class CallIn :  EntityBase,ICreatedTime, IAudited,IPassAutited,IRecyclable
    {
        /// <summary>
        ///调入单号
        /// </summary>
        [Display(Name = "调入单号")]
        [Required, StringLength(50)]
        public string Code { get; set; }

        /// <summary>
        ///调入日期
        /// </summary>
        [Display(Name = "调入日期")]
        [Required, StringLength(50)]
        public string InDate { get; set; }

        /// <summary>
        ///发货人
        /// </summary>
        [Display(Name = "发货人")]
        public virtual User User { get; set; }
        /// <summary>
        ///发货人外键
        /// </summary>
        [Display(Name = "发货人外键")]
        public long UserId { get; set; }

        /// <summary>
        ///调出仓库
        /// </summary>
        [Display(Name = "调出仓库")]
        public virtual Warehouse OutWarehouse { get; set; }
        /// <summary>
        ///调出仓库外键
        /// </summary>
        [Display(Name = "调出仓库外键")]
        public long OutWarehouseId { get; set; }

        /// <summary>
        ///调入仓库
        /// </summary>
        [Display(Name = "调入仓库")]
        public virtual Warehouse InWarehouse { get; set; }
        /// <summary>
        ///调入仓库外键
        /// </summary>
        [Display(Name = "调入仓库外键")]
        public long InWarehouseId { get; set; }


        /// <summary>
        /// 明细
        /// </summary>
        [Display(Name = "明细")]
        public virtual ICollection<CallInDetail> CallInDetails { get; set; }

        /// <summary>
        ///备注
        /// </summary>
        [Display(Name = "备注")]
        [StringLength(500)]
        public string Remark { get; set; }

        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion
        #region IPassAutited 通过审核接口
        /// <summary>
        /// 审核状态
        /// </summary>
        [Display(Name = "审核状态")]
        public PassState PassState { get; set; }

        /// <summary>
        /// 审核用户
        /// </summary>
        [Display(Name = "审核用户")]
        public string PassAutitedUserId { get; set; }

        /// <summary>
        /// 审核时间
        /// </summary>
        [Display(Name="审核时间")]
        public DateTime? PassAutitedTime { get; set; }
        #endregion

        #region Implementation of IsDeleted 逻辑删除接口
        /// <summary>
        /// 逻辑删除接口
        /// </summary>
        [Display(Name = "是否删除")]
        public bool IsDeleted { get; set; }
        #endregion
    }
}
